<% content_for :title do %>
活动
<% end %>
<section class="panel">
  <% if current_user.present? %>
    <div class="pure-g">
      <div class="pure-u-1"><%= link_to '创建新的活动', new_event_path, class: "btn-default" %></div>
    </div>
  <% end %>
  <ul class="card-list pure-g">
    <% if @events.any? %>
      <%= render partial: "event_item", collection: @events, as: :event %>
    <% else %>
      <div class="pure-u-1">没有活动。</div>
    <% end %>
  </ul>
</section>

<%= paginate @events %>
